<template>
  <div>
    <el-row :gutter="20">
      <el-col :span="6">
        <el-card shadow="never">
          <div slot="header" class="clearfix">
            <span>
              <i class="el-icon-user" />
              总人数
            </span>
          </div>
          <div>
            <h1 style="font-size:150%;color:#909399">{{total}}</h1>
            <br />
            <p style="float:right;color:#909399">
              {{total}}人
              <i class="el-icon-user" />
            </p>
          </div>
          <br />
        </el-card>
      </el-col>
      <el-col :span="6" style="margin-left: 49%">
        <el-card shadow="never">
          <div slot="header" class="clearfix">
            <span>
              <i class="el-icon-trophy-1" />
              就业人数
            </span>
          </div>
          <div>
            <h1 style="font-size:150%;color:#909399">{{jy}}</h1>
            <br />
            <p style="float:right;color:#909399">
              {{jy}}人
              <i class="el-icon-trophy-1" />
            </p>
          </div>
          <br />
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>
<script>
export default {
  data() {
    return {
      total:0,
      ns:0,
      vs:0,
      jy:0
    };
  },
  created() {
    //加载数据
    this.$axios({
      url: this.$axios.defaults.baseURL+"/teacher/selectempinfo",
      method: "get",
      params:{
        major:sessionStorage.getItem("headmajor")
      }
    }).then(res => {
      for(let i = 0;i < res.data.length;i++){
        this.total += res.data[i].total;
        this.jy += res.data[i].ytotal;
      }
    })
  },
};

</script>
<style scoped>
#cycle {
  width: 30px;
  height: 25px;
  float: right;
  border-radius: 3px;
  color: white;
  padding-left: 10px;
}
</style>